package orchestration

import (
	"github.com/gin-gonic/gin"
	"github.com/gin-gonic/gin/binding"
	"github.com/go-playground/validator/v10"
	"github.com/gophercloud/gophercloud"
	"github.com/sirupsen/logrus"
	"openstack_api/client"
)

type Network struct {
	Name   string   `json:"name" required:"true"`
	Subnet []Subnet `json:"subnet" required:"true"`
}

type Subnet struct {
	Cidr      string   `json:"cidr,omitempty"`
	GatewayIP string   `json:"gateway_ip,omitempty"`
	DNS       []string `json:"dns,omitempty"`
}

func (n Network) getClient() (serviceClient *gophercloud.ServiceClient) {
	serviceClient = client.GetImageClient()
	return
}

func (n Network) UpdateNetwork(c *gin.Context) {
	logrus.Info("Create Network, get started")
	//networkClient := n.getClient()

	_, ok := binding.Validator.Engine().(*validator.Validate)
	if ok != false {

	}
}
